﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<div id="client">
    <div id="sclient">
        <% List<Advertising> list = (List<Advertising>)ViewData["MasterBottom"];
           int y = 0;
           for (int i = 0; i < list.Count; i += 3)
           {%>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="8" height="7">
                </td>
            </tr>
            <tr align="left">
                <td width="1%">
                    &nbsp;
                </td>
                <%for (int z = 0; z < 3; z++)
                  {
                      if (y < list.Count)
                      {
                          Advertising obj = list[y];
                          string link = string.Empty;
                          if (obj.IsIntenalLink)
                          {
                              link = FRouter._("quangcao", obj.ID.ToString(), obj.Title);
                          }
                          else
                          {
                              link = obj.ExternalLink;
                          }
                          string image = obj.Image;
                          if (string.IsNullOrEmpty(image))
                          {
                              image = "NoImage.jpg";
                          }
                          int[] size = CommonFunc.FixImageSize(300, 79, Server.MapPath(Constants.UPLOAD_ADV_IMAGE_PATH + image));

                          string imgTag = "<img  src='" + Constants.UPLOAD_ADV_IMAGE_PATH + image + "' width='" + size[0] + "' height='" + size[1] + "' title='" + HttpUtility.HtmlEncode(obj.Title) + "' />";
                %>
                <td width="9%" style="text-align:center">
                    <%="<a href="+link+">"+imgTag+"</a>" %>
                </td>
                <%--<td width="20%">
                    <p >
                             <%="<a class='lnkbottom' href=" + link + "><strong>" + HttpUtility.HtmlEncode(obj.Title) + "</strong></a>"%>
                    </p>
                </td>--%>
                <%y++;
                      } } %>
                <td width="1%">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="8" height="7">
                </td>
            </tr>
        </table>
        <%} %>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#sclient').cycle({
            fx: 'scrollDown',
            sync: 0,
            delay: 4000,
            pause: 1
        });
    });
</script>
